package com.org.mapper;

import com.org.entity.Userlist;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Rainy-Heights
* @description 针对表【userlist】的数据库操作Mapper
* @createDate 2023-03-08 11:03:00
* @Entity com.org.entity.Userlist
*/
public interface UserListMapper {

    @Select("select * from renjiancihua.userlist")
    List<Userlist> getAllUser();

    @Insert("insert into renjiancihua.uerlist(username,role,specials,hobby) values(#{username},#{role},#{specials},#{hobby})")
    int insertNewUser(@Param("username") String username,@Param("role") String role,
                  @Param("specials") String specials,@Param("hobby") String hobby);

    @Select("select count(1) from renjiancihua.userlist")
    int getActiveNum();
}
